//
//  RSDCNextCell.m
//  SanYiTeaching
//
//  Created by 李文强 on 2019/5/30.
//  Copyright © 2019 SanYi. All rights reserved.
//

#import "RSDCNextCell.h"

@implementation RSDCNextCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initSubView];
        [self addShowView];
    }
    return self;
}
- (void)initSubView{
    [self addSubview:self.webView];
    [_webView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@20);
        make.right.equalTo(@0).offset(-20);
        make.top.equalTo(self.mas_top).offset(0);
        make.bottom.equalTo(self.mas_bottom).offset(-50);
    }];
}
- (void)addShowView{
    [self addSubview:self.baseView];
    [_baseView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@0);
        make.right.equalTo(@0);
        make.height.equalTo(@30);
        make.top.equalTo(self.mas_bottom).offset(-35);
    }];
    
    [_baseView addSubview:self.shiTiLabel];
    [_shiTiLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@10);
        make.width.equalTo(@100);
        make.centerY.equalTo(self->_baseView.mas_centerY);
        make.height.equalTo(@30);
    }];
    
    [_baseView addSubview:self.duiLabel];
    [_duiLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self->_shiTiLabel.mas_right).offset(20);
        make.width.equalTo(@100);
        make.centerY.equalTo(self->_baseView.mas_centerY);
        make.height.equalTo(@30);
    }];
    
    [_baseView addSubview:self.cuoLabel];
    [_cuoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self->_duiLabel.mas_right).offset(20);
        make.width.equalTo(@100);;
        make.centerY.equalTo(self->_baseView.mas_centerY);
        make.height.equalTo(@30);
    }];
    
    [_baseView addSubview:self.zhengQueLabel];
    [_zhengQueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self->_cuoLabel.mas_right).offset(20);
        make.width.equalTo(@100);
        make.centerY.equalTo(self->_baseView.mas_centerY);
        make.height.equalTo(@30);
    }];
    
    [_baseView addSubview:self.biaoQianLabel];
    [_biaoQianLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self->_zhengQueLabel.mas_right).offset(20);
        make.right.equalTo(self.mas_right).offset(-10);
        make.centerY.equalTo(self->_baseView.mas_centerY);
        make.height.equalTo(@30);
    }];
    
}

- (WKWebView *)webView{
    if (!_webView) {
        WKWebView *web = [[WKWebView alloc]init];
        web.scrollView.scrollEnabled = NO;
        web.backgroundColor = [UIColor whiteColor];
        _webView = web;
    }
    return _webView;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (UIView *)baseView{
    if (!_baseView) {
        UIView *view = [[UIView alloc]init];
        view.backgroundColor = [UIColorChange colorwithHexString:@"#F8F8F8"];
        _baseView = view;
    }
    return _baseView;
}
- (UILabel *)shiTiLabel{
    if (!_shiTiLabel) {
        UILabel *label = [[UILabel alloc]init];
        label.textColor = TITLECOLOR;
        label.textAlignment = 0;
        label.font = [UIFont systemFontOfSize:14];
        _shiTiLabel = label;
    }
    return _shiTiLabel;
}
- (UILabel *)duiLabel{
    if (!_duiLabel) {
        UILabel *label = [[UILabel alloc]init];
        label.textColor = TITLECOLOR;
        label.textAlignment = 0;
        label.font = [UIFont systemFontOfSize:14];
        _duiLabel = label;
    }
    return _duiLabel;
}
- (UILabel *)cuoLabel{
    if (!_cuoLabel) {
        UILabel *label = [[UILabel alloc]init];
        label.textColor = TITLECOLOR;
        label.textAlignment = 0;
        label.font = [UIFont systemFontOfSize:14];
        _cuoLabel = label;
    }
    return _cuoLabel;
}
- (UILabel *)zhengQueLabel{
    if (!_zhengQueLabel) {
        UILabel *label = [[UILabel alloc]init];
        label.textColor = TITLECOLOR;
        label.textAlignment = 0;
        label.font = [UIFont systemFontOfSize:14];
        _zhengQueLabel = label;
    }
    return _zhengQueLabel;
}
- (UILabel *)biaoQianLabel{
    if (!_biaoQianLabel) {
        UILabel *label = [[UILabel alloc]init];
        label.textColor = TITLECOLOR;
        label.textAlignment = 0;
        label.font = [UIFont systemFontOfSize:14];
        _biaoQianLabel = label;
    }
    return _biaoQianLabel;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}
@end
